<?php
	if(isset($_GET['uid'])&&intval($_GET['uid'])>0)
	{
		$uid=intval($_GET['uid']);
	}
	else
	{
		if($logid!=false)
			$uid=$logid;
		else
			edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
	}
	
	$link = edp_href_link( PAGENAME_USER_LIST, "uid=$uid" );
?>
<div class="main_box">    
    <div id="mainContent_2">
    	      
    	<!-- 评单列表begin -->
		<div id="list-list">
			 

			
			<div class="order_box">
            	<div class="order_box_l"></div>
                <div class="order_box_m">
                	<div class="ordertitle"><?php secho( $user ); ?>的评单（<?php echo $listCount; ?>）</div>
            		 <div class="orderlink">
						<a href="<?php echo edp_href_link(PAGENAME_LIST_SUMMARY); ?>">查看所有评单>></a>
                     </div>                      
                </div>
                <div class="order_box_r"></div>
            </div>
			
            <div class="box">
            	<div id="toolbar">
            		<div class="list_sort"> 
		            	 <form id="sortform" action="index.php" method="GET">
		            	 	<input type="hidden" name="page" value="<? echo PAGENAME_USER_LIST; ?>" />      	 
							<input type="hidden" id="s" name="s" value="<?php if(!edp_is_empty_string($s)) echo $s;?>" />
								
			                按照&nbsp;<a id="sort_view_count" href="<?php echo $link . "/?s=1"?>">人气</a> | 
			                <a id="sort_create_time" href="<?php echo $link . "/?s=2"?>">时间</a> | 
			                <a id="sort_response_count" href="<?php echo $link . "/?s=3"?>">回应数</a> | 
			                <a id="sort_flower_count" href="<?php echo $link . "/?s=4"?>" >鲜花数</a>  排序  
		                 </form>
                	</div>
                </div>
                <ul>
				                
                  <?php  
                  if( $lists ){
                  	foreach( $lists as $key => $value ){
           		 ?>
           		                
                	<li> <a href="<?php echo edp_href_link(PAGENAME_USER_LIST_INFO,'lid='.$value['id']); ?>"><img src="<?php echo $value['pic_path']; ?>"></a></img>
                    <h3><a href="<?php echo edp_href_link(PAGENAME_USER_LIST_INFO,'lid='.$value['id']); ?>"><?php secho( $value['title'] ); ?></a></h3>
                        <div id="list-content"><?php secho( $value['description'] ); ?><span>(全部<?php echo $value['c2c_count']; ?>家店铺，<?php echo $value['b2c_count']; ?>家商城，<?php echo $value['product_count']; ?>件商品)</span></div>
                        <div id="tags">标签：
                       <?php
	                      if(isset($value['tags'])){
	                      	$tagArr =  explode(" ", trim($value['tags']));            		                       
	                      	foreach($tagArr as $key=>$tagValue){
		                     echo '<a href ="'.edp_href_link(PAGENAME_LIST_SUMMARY,'t='.$tagValue). '">'.$tagValue.'</a>'.'&nbsp;&nbsp;';
		                    }
	                      } 
                       ?>                        
                        </div>
                        <div id="adder">
                        	<?php
                        	if($logid!=$uid)
                        	{ 
                        	?>
                        	<a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$uid); ?>">
                        		<?php secho( $user ); ?>
                        	</a> 
                        	<?php 
                        	}
                        	?>
                        	发表于 <?php echo $value['create_time'];  ?> | 
                        	<?php 
                        	if($logid&&$logid==$uid)
                        	{
                        	?>
                       		 	<a href="<?php echo edp_href_link(PAGENAME_USER_LIST_CREATE, 'lid='.$value['id']); ?>">修改评单</a>
                       		 	<a href="#" onclick="del_list(<?php echo $value['id']; ?>, this)">删除评单</a>
                        	<?php 
                        		
                        	}
                        	else
                        	{
                        	?>
	                        	<a href="<?php echo edp_href_link(PAGENAME_LIST_INFO, 'lid='.$value['id']);?>">回应</a><span>(<?php echo $value['response_count']; ?>)</span> | 
	                       	 	<a id="Flower<?php echo $value['id'];?>" onclick="event.preventDefault(); popupFlowerWindow('list','<?php echo $value['id']; ?>')"  href="#">鲜花</a><?php if(intval($value['flower_count'])>=0) echo '<span id="Flower'.$value['id'].'" >('.$value['flower_count'].')</span>'; ?> |
	                        	<a id="Egg<?php echo $value['id'];?>" onclick="popupEggWindow('list','<?php echo $value['id']; ?>')"  href="#">鸡蛋</a><?php if(intval($value['egg_count'])>=0) echo '<span id="Egg'.$value['id'].'" >('.$value['egg_count'].')</span>'; ?>
                        	<?php
                        	} 
                        	?>
                        	
                        
                      
                        
                        </div>
						<div style="clear:both"></div>
                    </li>
                    
					<?php
                  	}
					}
					?>
					
                </ul>
                <div style="clear:both"></div>
            </div>
            <div class="btm"></div>
        </div>
    	<!-- 评单列表end -->
        
       <?php  echo $page->getBar(); ?>       
	</div>



	<div id="sidebar_right">
	
		<!-- 什么是评单begin -->
	    <div id="what-list">
	    	<h4>什么是评单？</h4>
	        <p>
	        评单是任何一位评友基于某个特定主题的一系列推荐。比如"淘宝男装推荐店铺"、"十件女生夏季必淘鞋子"、"淘宝有趣店铺收集", 等等。评单将出现在被推荐的每一种店铺、商城、商品的页面里，按对别人的有用程度排序。一个评单里的收藏总数不超过30个。
	        </p>
	    </div>
	    
	    <!-- 什么是评单end -->
	    
	    <!-- 创建评单begin -->
	    <div id="creat-list">
	    	<a href="<?php echo edp_href_link(PAGENAME_USER_LIST_CREATE);?>"><img src="<?php echo IMAGE_DIR; ?>btn_creat_list.gif" width="200" height="47" alt="创建评单" /></a>
	    </div>
	<!-- 创建评单end -->
	    
	    <!-- 搜索评单begin -->
	    <div id="searchbox">
	    	<form action="<?php echo edp_href_link(PAGENAME_LIST_SUMMARY); ?>" method="get">
	        	<input value="<?php if(isset($q2)) echo $q2; ?>" name="q" type="text" class="myinput"  />
	            <input class="btn_5" value="搜索评单" type="submit" />
	      </form>
	    </div>
	    <!-- 搜索评单end  -->
	    
	
	</div>
</div>
<div id=flowerAndEggBox style="display:none;cursor:default;" class="popup"></div>